const userModule = {
  namespaced: true,
  state: {
    userInfo: {
      nickname: 'Daisy',
      balance: 500,
      concern: 22,
      avatarUrl: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg',
    },
  },
  getters: {
    userInfo: (state) => state.userInfo,
    userbalance: (state) => state.userInfo.balance,
  },
  mutations: {
    pay(state, payload) {
      state.userInfo.balance = state.userInfo.balance + Number(payload)
    },
    remainingAmount(state, payload) {
      state.userInfo.balance = state.userInfo.balance - Number(payload)
    },
    modifyName(state, payload) {
      state.userInfo.nickname = payload
    },
  },
  actions: {},
}
export default userModule
